if (typeof(SBProperties) == "undefined") {
	Components.utils.import("resource://app/jsmodules/sbProperties.jsm");
	if (!SBProperties)
		throw new Error("Failed to import sbProperties.jsm");
}

if (typeof(LibraryUtils) == "undefined") {
	Components.utils.import("resource://app/jsmodules/sbLibraryUtils.jsm");
	if (!LibraryUtils)
		throw new Error("resource://app/jsmodules/sbLibraryUtils.jsm");
}

if (typeof(SBJobUtils) == "undefined") {
	Components.utils.import("resource://app/jsmodules/SBJobUtils.jsm");
	if (!SBJobUtils)
		throw new Error("Failed to import resource://app/jsmodules/SBJobUtils.jsm");
}

function LM_scanLibSet(){

	var list = LibraryUtils.mainLibrary;
	
   
	//  Create an enumeration listener to count each item  
	var listener = {  

		onEnumerationBegin: function(aMediaList) {},
  
		onEnumeratedItem: function(aMediaList, aMediaItem) {

                       var lyrics=aMediaItem.getProperty("http://songbirdnest.com/data/1.0#lyrics");
                       var haslyr=aMediaItem.getProperty("http://songbirdnest.com/data/1.0#hasLyrics");
        
                       if ((lyrics != null) && (haslyr == null))
                       {
                               aMediaItem.setProperty("http://songbirdnest.com/data/1.0#hasLyrics", "chrome://lyricmaster/content/images/haslyrics.png");
                       }
                              
                       else if ((lyrics == null) && (haslyr != null))
                       {
                               aMediaItem.setProperty("http://songbirdnest.com/data/1.0#hasLyrics", null);
                       }
                },  
		
                onEnumerationEnd: function(aMediaList, aStatusCode) {}  
 	};

	list.enumerateAllItems(listener);

}
